/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-08-03     RT-Thread    first version
 */

#include <rtthread.h>

#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>

int main(void)
{
    int count = 1;
//    int i;
//    char *ptr = RT_NULL;
//    for(i = 0; ; i++)
//    {
//        ptr = rt_malloc(1 << i);
//        if(ptr != RT_NULL)
//        {
//            rt_kprintf("get memory :%d byte\n", (1 << i));
//            /* 释放内存块 */
//            rt_free(ptr);
//            rt_kprintf("free memory :%d byte\n", (1 << i));
//            ptr = RT_NULL;
//
//        }
//        else
//        {
//            rt_kprintf("try to get %d byte memory failed!\n", (1 << i));
//            return RT_EOK;
//        }
//    }
    while (count++)
    {
        LOG_D("Hello RT-Thread! count = %d" , count);
        rt_thread_mdelay(1000);
    }

    return RT_EOK;
}
